home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6386 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: the-fly.zip.com.au!not-for-mail
  2. From: stuartm@zip.com.au (Stuart Mackinnon)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Q: Scrolling a Window
  5. Date: 27 Mar 1996 01:05:31 GMT
  6. Organization: Very Little
  7. Message-ID: <4ja48r$hva@the-fly.zip.com.au>
  8. References: <4j5r2n$566@ousrvr3.oulu.fi> <Pine.LNX.3.91.960326113409.12997A-100000@mix.hsv.no>
  9. NNTP-Posting-Host: zipper.zip.com.au
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Leonard Faanes (shoeless@mix.hsv.no) wrote:
  13. > On 25 Mar 1996, Timo Karjalainen wrote:
  14. > > I'm wondering what would be the best way to scroll a screen-size
  15. > > non-superbitmap window. The screen might be HUGE, i.e. the window
  16. > > might be HUGE. From what I see in the AutoDocs, ScrollLayer() is
  17. > > of use only for SuperBitMaps. (I do have GZZ.) 
  18. > > 
  19. > > In fact there are prop gadgets in the borders and I should scroll
  20. > > the window contents as the user plays with the gads.
  21. > 1. Do NOT use GZZ Windows. That kind of 'two-layer' window should
  22. >    NEVER (I really mean NEVER) be used. If you need to clip various drawing 
  23. >    routines to your borders, use a clip-region. However, it seems like
  24. >    (out of your question) that you don't really need that clipping.
  25. > 2  If >=V39 use ScrollWindowRaster() (This one got a bug with backfill
  26. >    hooks and damage regions, but don't worry about that)
  27. >    If <V39 use ScrollRaster() or ClipBlit().
  28.  
  29. In fact it would probably be best to do ScrollRaster() AND ClipBlit().
  30. Refer to the "Optimised Window Refreshing" AmigaMail article to
  31. understand why it is best to use both. Basically you use ScrollRaster()
  32. to do the blit, then set the write mask to 0 and use ClipBlit() to
  33. scroll the damage areas. Then set the write mask back to what it was.
  34.  
  35. The reason for this is that ClipBlit() does its blit and then does
  36. a second blit to clear the area that was scrolled in. ScrollRaster()
  37. does not do this - which is OK, cause you will probably be rendering
  38. over the top of that area anyway. But ScrollRaster will not deal
  39. with damage regions properly, so you have to use ClipBlit() with a
  40. mask of 0 (so that is doesn't actually blit anything) to scroll the
  41. damage regions.
  42.  
  43. Both these functions use RastPorts as arguments, not bitmaps, which
  44. should mean that the OS will take care of any multple blits required
  45. for a really wide or tall RastPort.
  46.  
  47. Don't use GZZ. Firstly it uses a LOT more CHIP ram, and is much slower
  48. on window moves and resizes. The only reason anyone would EVER need to
  49. use a GZZ window is if they want GadTools gadgets clipped to the
  50. window border (GadTools seems to screw around with clipping regions
  51. such that they are ignored during any GadTools gadget rendering).
  52.  
  53. Regards,
  54.  
  55. Stuart MacKinnon.
  56. -- 
  57.  
  58. +- Stuart MacKinnon ------------------------------------ stuartm@zip.com.au -+
  59. |  VIC20, CBM 128+1571, A1000+Sidecar, CD32, A4000/040+A4091+A2065+RetinaZ3! |
  60. |  Registered BeBox Developer - for those at the bleeding edge.              |
  61. |  PHONE: +61 2 398 4578 (AH)                            +61 2 693 0445 (BH) |
  62. +--- Aztec C - Use it to MANXimise code inefficiency! -----------------------+
  63.